
#pragma once

#include <cstdint>
#include <vector>
#include <string>

namespace ecarx::transfer{

    enum class SignalType:uint32_t{
        SIGNAL = 0x10000000,
        CBPA = 0x20000000,
        SOMEIP = 0x30000000,
        CPIPCP = 0x40000000,
        MASK   = 0xf0000000,
    };

    enum class SignalAccess:uint32_t{

        WRITE = 0x01000000,
        READ  = 0x02000000,
        MASK  = 0x0f000000,
    };

    enum class  ValueType:uint32_t{

        STRING          = 0x00100000,
        BOOLEAN         = 0x00200000,
        INT32           = 0x00400000,
        INT32_VEC       = 0x00410000,
        INT64           = 0x00500000,
        INT64_VEC       = 0x00510000,
        FLOAT           = 0x00600000,
        FLOAT_VEC       = 0x00610000,
        BYTES           = 0x00700000,

        MASK            = 0x00ff0000
    };

    enum class NotifyMode: int32_t{
        ValueChanged = 1,
        Direct = 2
    };

    typedef struct {
        struct RawValue {
            std::vector<int32_t> int32Values __attribute__((aligned(8)));
            std::vector<int64_t> int64Values __attribute__((aligned(8)));
            std::vector<float> floatValues __attribute__((aligned(8)));
            std::vector<uint8_t> bytes __attribute__((aligned(8)));
            std::string stringValue __attribute__((aligned(8)));
        };
        int32_t signalId __attribute__((aligned(8)));
        RawValue value __attribute__((aligned(8)));
        NotifyMode mode  __attribute__((aligned(8))) = NotifyMode::ValueChanged;
        
    } Signal;
}


